using System;
using System.Collections.Generic;
using System.Text;
using NHibernate;
using DATA.BusinessObjects;
using DATA.Base;

namespace DATA.ManagerObjects
{
    public partial interface IPhongManager : IManagerBase<DATA.BusinessObjects.Phong, string>
    {
		// Get Methods
		IList<Phong> GetByMaLoaiPhong(System.String loaiphong);
    }

    partial class PhongManager : ManagerBase<DATA.BusinessObjects.Phong, string>, IPhongManager
    {
		#region Constructors
		
		public PhongManager() : base()
        {
        }
        public PhongManager(INHibernateSession session) : base(session)
        {
        }
		
		#endregion
		
        #region Get Methods

		
		public IList<Phong> GetByMaLoaiPhong(System.String loaiphong)
        {
            ICriteria criteria = Session.GetISession().CreateCriteria(typeof(Phong));
			
			
			ICriteria loaiphongCriteria = criteria.CreateCriteria("Loaiphong");
            loaiphongCriteria.Add(NHibernate.Criterion.Expression.Eq("Id", loaiphong));
			
			return criteria.List<Phong>();
        }
		
		#endregion
    }
}